<template>
    <el-dialog title="请您对客服进行评价" v-model="showDialog" style="width:350px;height: 200px;border-radius:
     10px;padding: 0">
        <div style="text-align: center"><el-rate v-model="satisfy"  allow-half /></div>
        <el-button style="width: 50%;margin: 0 25%"  @click="doSatisfy">评价</el-button>
    </el-dialog>
</template>

<script setup>
    import request from '@/utils/request.js'
    import { ElMessage } from 'element-plus'
    import {reactive, ref, onMounted } from 'vue'
    let props = defineProps(["chatId"])
    let showDialog = ref(false)
    let satisfy = ref(0)
    onMounted(()=>{
    })
    function doSatisfy() {
        let score = 2 * satisfy.value;
        request.get(`/api/portal/satisfy/${props.chatId}/${score}`).then(resp => {
            ElMessage({message: '评价成功！',type: 'success'})
            showDialog.value = false
        })
    }
    defineExpose({showDialog})
</script>
<style scoped>
    .loginItem{
        height:35px;
        font-size: 16px;
    }
</style>